<template>
	<view class="mian-page">
		<!-- <button class="test-button flex-row-center-center" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
			点我测试
		</button> -->
		<!-- <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button> -->
		<!-- <mbtiLogin ref="mbtiLogin"></mbtiLogin> -->
	</view>
</template>

<script>
	import mbtiLogin from "@/components/m-mbti/mbti-login.vue"
	import {
		handleGetLoginCodePlugin
	} from "@/utils/silentLogin.js"
	import {
		autoLogin
	} from "@/api/mbti"
	export default {
		components: {
			mbtiLogin
		},
		data() {
			return {}
		},
		methods: {
			onChooseAvatar(e) {
				console.log("宝宝", e)
			},
			handleClick() {
				console.log("你好")
				// https://s2.aigei.com/src/aud/mp3/60/60626053da5146d4836b3f00252a70ee.mp3?e=1744274280&token=P7S2Xpzfz11vAkASLTkfHN7Fw-oOZBecqeJaxypL:pLWkSX0uuasWtgbBB3UY6C-MrOE=
				// uni.createAudioContext()

				handleGetLoginCodePlugin().then(res => {
					console.log(res);
					let code = res
					autoLogin({
						code
					}).then(res => {
						console.log("接口调用", res);
						// let {
						// 	clientHash,
						// 	expire,
						// 	hasRegister,
						// 	openid,
						// 	token
						// }
					})

				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mian-page {
		width: 100vw;
		height: 100vh;
		background-color: #fff;

		.test-button {
			position: absolute;
			left: 50%;
			top: 50%;
			transform: translate(-50%, -50%);
			width: 200rpx;
			height: 80rpx;
			background-color: pink;
			border-radius: 20rpx;
		}
	}
</style>